package ObjectsPlus;

import java.util.ArrayList;

public class GetMaxNumber {
    private GetMaxNumber(){}

    public static int getMaxAge(ArrayList<Student> list){
        int max = list.get(0).getAge();
        for (int i = 0; i < list.size(); i++) {
            if(max > list.get(i).getAge()){
                max = max;
            }else{
                max = list.get(i).getAge();
            }
        }
        return max;
    }
}
